home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / win_q_t / trem.zip / TERMINAL.C < prev    next >
Text File  |  1991-05-11  |  2KB  |  76 lines

  1. /************************************************************************
  2.  *
  3.  *    Copyright (c) 1991 Microsoft Corporation.  All Rights Reserved.
  4.  *
  5.  *-----------------------------------------------------------------------
  6.  *
  7.  *     Project:  Windows Terminal Example
  8.  *
  9.  *      Module:  terminal.c
  10.  *
  11.  *      Author:  Bryan A. Woodruff (baw)
  12.  *
  13.  *
  14.  *     Remarks:  A terminal communication example for Windows 3.0.
  15.  *               This is to show a better way to handle asynchronous
  16.  *               communications rather than the brain-dead way TTY.C
  17.  *               handles it.
  18.  *
  19.  *               This example is a TTY example - no codes are translated
  20.  *               besides the necessary LF, CR, BS, etc.
  21.  *
  22.  *
  23.  *   Revisions:
  24.  *     01.00.000  5/ 9/91 baw   Wrote it
  25.  *
  26.  ************************************************************************/
  27.  
  28. // define GLOBAL definitions... all other modules reference these as
  29. // externals
  30.  
  31. #define GLOBALDEFS
  32.  
  33. #include "terminal.h"
  34.  
  35. /************************************************************************
  36.  *  int PASCAL WinMain( HANDLE hInstance, HANDLE hPrevInstance,
  37.  *                      LPSTR lpszCmdLine, int nCmdShow )
  38.  *
  39.  *  Description:
  40.  *     This is the main window procedure.
  41.  *
  42.  *  Comments:
  43.  *      5/ 8/91  baw  Wrote it.
  44.  *
  45.  ************************************************************************/
  46.  
  47. int PASCAL WinMain( HANDLE hInstance, HANDLE hPrevInstance,
  48.                     LPSTR lpszCmdLine, int nCmdShow )
  49. {
  50.    HWND  hwndTerminal ;
  51.    MSG   msg ;
  52.  
  53.    if (!hPrevInstance)
  54.       if (!InitApplication( hInstance ))
  55.          return ( FALSE ) ;
  56.  
  57.    if (!InitInstance( hInstance, nCmdShow, &hwndTerminal ))
  58.       return ( FALSE ) ;
  59.  
  60.    while (GetMessage( &msg, NULL, 0, 0 ))
  61.    {
  62.       if (!TranslateAccelerator( hwndTerminal, hAccel, &msg ))
  63.       {
  64.          TranslateMessage( &msg ) ;
  65.          DispatchMessage( &msg ) ;
  66.       }
  67.    }
  68.    return ( msg.wParam ) ;
  69.  
  70. } /* end of WinMain() */
  71.  
  72. /************************************************************************
  73.  * End of File: terminal.c
  74.  ************************************************************************/
  75.  
  76.